package LeetCode;

import sun.applet.Main;

@SuppressWarnings("unused")
public class _509_斐波那契数 {
	public static void main(String[] args) {
		System.out.println(fib(5));
	}

	static public int fib(int N) {
		if (N <= 1)
			return N;
		int first = 0;
		int second = 1;
		while (N-- > 1) {
			second = first + second;
			first = second - first;
		}
		return second;
	}
}
